const utils = {
    getUrldata:function(name){
        try {
            let search = location.search 
            const p = new URLSearchParams(search)
            console.log(p);
            let str = p.get(name)
            console.log(str);
            if(name == "head"){
              return str
            }else{
            if(str == null){
                throw new Error("字段可能錯了，是不是data字段没写对？")
            }
            let o = JSON.parse(str)
            console.log(o);
            return o
            }
        } catch (error) {
            console.log(error,"可能沒有数据源");
        }
    }
}